//
//  BJModel.m
//  BobNews
//
//  Created by lanou3g on 16/5/7.
//  Copyright © 2016年 YJC. All rights reserved.
//

#import "BJModel.h"
#import "BJImageModel.h"
#import "BJMoreModel.h"

@implementation BJModel

+(instancetype)modelWithDictionary:(NSDictionary *)dictionary{
    
    NSString *imageStr = dictionary[@"imgextra"];
    if (imageStr) {
        
        BJMoreModel *moreModel = [[BJMoreModel alloc]init];
        [moreModel setValuesForKeysWithDictionary:dictionary];
        return moreModel;
        
    } else {
         BJImageModel *imgModel = [[BJImageModel alloc]init];

        [imgModel setValuesForKeysWithDictionary:dictionary];
        return imgModel;
        
    }
    
    return nil;
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

-(void)setValue:(id)value forKey:(NSString *)key{
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"url"]) {
        self.BJUrl = value;
    }
    
}










@end
